package cn.tedu.submarine_2;

import javax.swing.ImageIcon;

public class Bomb extends SeaObject{
    public Bomb(int x, int y) {
        super(9,12,x,y,3);
    }

    @Override
    public void move() {
        y+=speed;//炸弹向下移动
    }

    @Override
    public ImageIcon getImage() {
        return Images.bomb;
    }

    /**
     * 判断是否越界，炸弹的y大于窗口的高即为越界
     * @return
     */
    public boolean isOutOfBounds(){
        return this.y>=World.HEIGHT;
    }
}
